package com.starlight.flower_server.infrastructure.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.starlight.flower_server.domain.item.cqrs.ItemPageQuery;
import com.starlight.flower_server.infrastructure.entity.Item;

import java.util.List;
import java.util.Map;

/**
 * @Author yfy2001
 * @date 2023/4/18 8:16
 */
public interface ItemRepository {
    Item queryDetail(Long id);

    Integer logicDelete(Long id);

    Integer insert(Item item);

    Integer modify(Item item);

    Integer autoModifyStock(Item item);

    Map<Long,Item> queryMap(List<Long> itemIdList);

    IPage<Item> queryPage(ItemPageQuery query);

    IPage<Item> queryPageByCategory(List<Long> categoryIdList,ItemPageQuery query);

    List<Item> queryAll();

    Long queryTotalCount();

    List<Item> queryRandom(Integer count);

    List<Item> queryByCategory(List<Long> itemCategoryIdList);
}
